<template>
    <keep-alive :include="cachedRoutes" :max="keepAliveMaxNum">
        <!-- 需要Query动态路由多级缓存，可取消key相关的代码注释(注意:使用key会导致开发模式中热更新失效，需要手动刷新)-->
        <!-- <router-view :key="key" />-->
        <router-view/>
    </keep-alive>
</template>

<script lang="ts">
import {keepAliveMaxNum} from '@/config/setting.config'
import Vue from 'vue'
import Component from 'vue-class-component';
import {RouterGetterEnum} from "../../../store/enum/store.enum";

@Component({})
export default class VabKeepAlive extends Vue {

    private keepAliveMaxNum = keepAliveMaxNum;

    get cachedRoutes() {
        return this.$store.getters[RouterGetterEnum.cachedRoutes];
    };

}
</script>
